package com.jxpanda.starter.config.security.token;


import com.jxpanda.starter.config.security.AuthenticationProperties;
import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.JwtParser;

/**
 * @author Panda
 */
@SuppressWarnings("AlibabaClassNamingShouldBeCamel")
public class RSAHelper extends AbstractTokenHelper {

    public RSAHelper(AuthenticationProperties authenticationProperties) {
        super(authenticationProperties);
    }

    @Override
    protected JwtBuilder signWith(JwtBuilder jwtBuilder) {
        return jwtBuilder.signWith(algorithm, privateKey);
    }

    @Override
    protected JwtParser setSigningKey(JwtParser jwtParser) {
        return jwtParser.setSigningKey(publicKey);
    }
}
